"""
传感器任务模块
日期: 2024/12/19
"""

# 基类
class TaskSensor():
    def __init__(self, driver_instance):
        self.driver_instance = driver_instance
        
        self.sensor_init()
        
    def sensor_init(self):
        pass    

    def read_data(self):
        pass


# 气压
class TaskAtmosphericPressure(TaskSensor):        
    def read_data(self):
        pressure = self.driver_instance.getPress()
        return pressure


# 温湿度
class TaskTempHumi(TaskSensor):
    def read_data(self):
        temp = self.driver_instance.temperature
        humi = self.driver_instance.relative_humidity
        return temp, humi


# 光照
class TaskLight(TaskSensor):
    def sensor_init(self):
        self.driver_instance.set_h_resolution() 
        
    def read_data(self):
        lux = self.driver_instance.get_lux()
        return lux
    
    